from django.contrib import admin
from .models import Log


@admin.register(Log)
class LogAdmin(admin.ModelAdmin):
    list_display = ['timestamp', 'level', 'source', 'message', 'user']
    list_filter = ['level', 'source', 'timestamp']
    search_fields = ['message', 'user__username']
    readonly_fields = ['timestamp']
    ordering = ['-timestamp']